// Copyright DustedPixels.com 2008. All rights reserved.

package com.dustedpixels.jasmin.asm;

/**
 * @author micapolos@gmail.com (Michal Pociecha-Los)
 */
public final class NandGateImpl extends NandGate {
  private final AndGate andGate;
  private final NotGate notGate;

  public NandGateImpl(AndGate andGate, NotGate notGate) {
    this.andGate = andGate;
    this.notGate = notGate;
  }
  
  public void update() {
    andGate.IN1 = IN1;
    andGate.IN2 = IN2;
    andGate.update();
    notGate.IN = andGate.OUT;
    notGate.update();
    OUT = notGate.OUT;
  }
}
